<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>爱贝儿医欢迎您</title>

    <link rel="stylesheet" href="business/style/common.css?<?=版本?>">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"/>
    <script src="business/resource/js/jquery-1.11.1.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="business/resource/js/bootstrap.min.js"></script>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</head>

<body style="background-color:#fff;">

<div id="pewm">
    <?php if(!$user_myqrcode->data){?>
    <div class="tishi">
        <div class="tishi_bg" style="position:relative;width:100%;opacity: 0.8;background: #000;height:700px;"></div>
        <div class="tishi_cont">
            <div class="tishi_img"><img src="business/style/tishiimg.png" alt=""/></div>
            <div class="clear"></div>
            <div class="tishi_word">首次生成需分享该页面给好友~~</div>
        </div>
    </div>
    <?php }?>
    <div class="head">
        <div class="h-img"><img src="<?= $myself->data['头像']?>" alt=""> </div>
        <div class="h10"></div>
        <div class="h-jieshao"><div><img src="business/style/pewm.jpg" alt="" style="width:300px;"></div><span style="position:relative;height:82px;width:80%;top:-110px;">我是<?= $myself->data['name']?> 我在“爱贝儿医” 等你！</span></div>
        <div class="h-word">扫描下方二维码与我成为好友！</div>
    </div>
    <div class="cont">
        <span class="c-ort"><?= $myself->data['name']?></span>——<?= htmlspecialchars_decode(stripslashes($myself->data['description']))?>
    </div>
    <div class="cimg">
        <div class="cimg1">
            <div class="xr1"><img src="business/style/xiaoren.jpg" alt=""></div>
            <div class="xr2"><img src="<?php
                  if($user_myqrcode->data){
                 echo G_二维码查看目录 .$user_myqrcode->data['二维码编号'];
                  }else{
                      echo  "business/style/biankuang";
                }
                ?>.jpg" alt=""></div>
            <div class="clear"></div>
        </div>
    </div>

    <div class="footer">加入"爱贝儿医"与数十位来自省级以上重点三甲医院的儿科专家、重点医院儿科学科带头人、国内儿科权威人士组成的豪华专家团队零距离！</div>
    <?php require 'app/templates/common/download.html'; ?>
</body>
</html>

<script language="JavaScript">

    wx.config({
        debug: false,
        appId: '<?php echo $this->signPackage["appId"];?>',
        timestamp: <?php echo $this->signPackage["timestamp"];?>,
    nonceStr: '<?php echo $this->signPackage["nonceStr"];?>',
            signature: '<?php echo $this->signPackage["signature"];?>',
            jsApiList: [
        'onMenuShareAppMessage',
        'onMenuShareTimeline',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone'
    ]
    });

    wx.checkJsApi({
        jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
        success: function(res) {
            alert("checkjs"+res);
            // 以键值对的形式返回，可用的api值true，不可用为false
            // 如：{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
        }
    });

    wx.ready(function(){

        title = '爱贝儿医';
        desc = '爱贝儿医—专注于做儿科医生间学习工作交流平台。平台拥有数十位来自省级以上重点三甲医院的儿科专家、重点医院儿科学科带头人、国内儿科权威人士组成的豪华专家团队。';
        link = '';
        imgUrl = '<?= G_SITE_CDN ?>/business/img/logoRed2.png';

        function toBePromoter() {
        <?php  if(!$user_myqrcode->data && $_GET['uid'] == $user_id): ?>
            $.post('<?=$ajax_share_expend?>', {'user_id':<?=$user_id?>}, function(data) {
            alert(data);
        });
        <?php endif;?>
    }

    wx.onMenuShareTimeline({
        title: title, // 分享标题
        link: link, // 分享链接
        imgUrl: imgUrl, // 分享图标
        success: function () {
            // 用户确认分享后执行的回调函数
            toBePromoter();
        },
        cancel: function () {
            // 用户取消分享后执行的回调函数
        }
    });
    wx.onMenuShareAppMessage({
        title: title, // 分享标题
        desc: desc, // 分享描述
        link: link, // 分享链接
        imgUrl: imgUrl, // 分享图标
        type: '', // 分享类型,music、video或link，不填默认为link
        dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
        success: function () {
            // 用户确认分享后执行的回调函数
            toBePromoter();
        },
        cancel: function () {
            // 用户取消分享后执行的回调函数
        }
    });


    wx.onMenuShareQQ({
        title: title, // 分享标题
        desc: desc, // 分享描述
        link: link, // 分享链接
        imgUrl: imgUrl, // 分享图标
        success: function () {
            toBePromoter();
        },
        cancel: function () {
            // 用户取消分享后执行的回调函数
        }
    });

    wx.onMenuShareWeibo({
        title: title, // 分享标题
        desc: desc, // 分享描述
        link: link, // 分享链接
        imgUrl: imgUrl, // 分享图标
        success: function () {
            toBePromoter();
        },
        cancel: function () {
            // 用户取消分享后执行的回调函数
        }
    });
    wx.onMenuShareQZone({
        title: title, // 分享标题
        desc: desc, // 分享描述
        link: link, // 分享链接
        imgUrl: imgUrl, // 分享图标
        success: function () {
            toBePromoter();
        },
        cancel: function () {
            // 用户取消分享后执行的回调函数
        }
    });

    });


    wx.error(function(res){
        location.replace(location.href);
        // config信息验证失败会执行error函数，如签名过期导致验证失败，具体错误信息可以打开config的debug模式查看，也可以在返回的res参数中查看，对于SPA可以在这里更新签名。

    });
</script>
